package com.xugongzhang.spring.beanLife;

import com.xugongzhang.spring.beans.Person;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author X
 * @date 2022/12/3 21:08
 * Bean生命周期
 */
@Configuration
public class MainConfigOfLifeCycle {
    
    @Bean(initMethod = "init", destroyMethod = "destroy")
    public Person person() {
        return new Person("1", "y", 18);
    }
}
